package behavioral.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 公司类
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
public class Company implements ICompany {
    private List<Employee> employees;

    public Company() {
        this.employees = new ArrayList<Employee>();
    }

    public void addEmployee(Employee employee) {
        this.employees.add(employee);
    }

    public void removeEmployee(Employee employee) {
        this.employees.remove(employee);
    }

    public IIterator getIterator() {
        return new EmployeeIterator(employees);
    }
}
